home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 120 / CD Gamer Issue 120 (March 2003) (Disc 2).ISO / mods / Q2_Codered / codeRED1_0.exe / Data1.cab / vid_null.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-13  |  2.6 KB  |  112 lines

  1. /*
  2. Copyright (C) 1997-2001 Id Software, Inc.
  3.  
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  12.  
  13. See the GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. */
  20. // vid_null.c -- null video driver to aid porting efforts
  21. // this assumes that one of the refs is statically linked to the executable
  22.  
  23. #include "../client/client.h"
  24.  
  25. viddef_t    viddef;                // global video state
  26.  
  27. /*
  28. ==========================================================================
  29.  
  30. DIRECT LINK GLUE
  31.  
  32. ==========================================================================
  33. */
  34.  
  35. void VID_NewWindow (int width, int height)
  36. {
  37.     viddef.width = width;
  38.     viddef.height = height;
  39. }
  40.  
  41. /*
  42. ** VID_GetModeInfo
  43. */
  44. typedef struct vidmode_s
  45. {
  46.     const char *description;
  47.     int         width, height;
  48.     int         mode;
  49. } vidmode_t;
  50.  
  51. vidmode_t vid_modes[] =
  52. {
  53.     { "Mode 0: 320x240",   320, 240,   0 },
  54.     { "Mode 1: 400x300",   400, 300,   1 },
  55.     { "Mode 2: 512x384",   512, 384,   2 },
  56.     { "Mode 3: 640x480",   640, 480,   3 },
  57.     { "Mode 4: 800x600",   800, 600,   4 },
  58.     { "Mode 5: 960x720",   960, 720,   5 },
  59.     { "Mode 6: 1024x768",  1024, 768,  6 },
  60.     { "Mode 7: 1152x864",  1152, 864,  7 },
  61.     { "Mode 8: 1280x960",  1280, 960, 8 },
  62.     { "Mode 9: 1600x1200", 1600, 1200, 9 },
  63.     { "Mode 10: 2048x1536", 2048, 1536, 10 }
  64. };
  65. #define VID_NUM_MODES ( sizeof( vid_modes ) / sizeof( vid_modes[0] ) )
  66.  
  67. qboolean VID_GetModeInfo( int *width, int *height, int mode )
  68. {
  69.     if ( mode < 0 || mode >= VID_NUM_MODES )
  70.         return false;
  71.  
  72.     *width  = vid_modes[mode].width;
  73.     *height = vid_modes[mode].height;
  74.  
  75.     return true;
  76. }
  77.  
  78.  
  79. void    VID_Init (void)
  80. {
  81.     refimport_t    ri;
  82.  
  83.     viddef.width = 320;
  84.     viddef.height = 240;
  85.    
  86.     // call the init function
  87.     if (R_Init (NULL, NULL) == -1)
  88.         Com_Error (ERR_FATAL, "Couldn't start refresh");
  89. }
  90.  
  91. void    VID_Shutdown (void)
  92. {
  93.     R_Shutdown ();
  94. }
  95.  
  96. void    VID_CheckChanges (void)
  97. {
  98. }
  99.  
  100. void    VID_MenuInit (void)
  101. {
  102. }
  103.  
  104. void    VID_MenuDraw (void)
  105. {
  106. }
  107.  
  108. const char *VID_MenuKey( int k)
  109. {
  110.     return NULL;
  111. }
  112.